package com.jiazhong.mingxing.boot.boot13.listener;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
@RocketMQMessageListener(consumerGroup = "jiazhong_group_a", topic = "TopicA",
        selectorExpression = "*", messageModel = MessageModel.BROADCASTING)
public class ConsumerListener implements RocketMQListener<String> {

    @Override
    public void onMessage(String s) {
        log.info("你有新的消息了，消息是:{}", s);
    }
}
